program hanoi;

procedure shift(n : integer; d:integer);
begin
   writeln('RightShift','(', n, ', ', d, ')');
end;

procedure tower(n : integer; d: integer);
begin
   if n = 0 then exit;
   writeln('tower','(', n, ', ', d, ')');
   tower(n-1, -d);
   writeln('tower','(', n-1, ', ', -d, ')');
   shift(n, d);
   tower(n-1, -d);
   writeln('tower','(', n-1, ', ', -d, ')');
end; { tower }

var
   n, d	: integer;
begin	
   n := 3;
   d := 1;
   tower(n,d);
end.
